<clr-modal [(clrModalOpen)]="createUserOpened" [clrModalSize]="'lg'" >
  <h3 class="modal-title">{{userTitle}}</h3>
  <div class="modal-body">
    <form #userForm="ngForm">
      <section class="form-block">
        <div class="form-group" style="padding-left: 135px;">
          <label for="user_name" class="col-md-3 form-group-label-override required">名称</label>
          <label for="user_name" aria-haspopup="true" role="tooltip" [class.invalid]="!isNameValid" class="tooltip tooltip-validation tooltip-md tooltip-bottom-left">
            <input type="text" id="user_name"  [(ngModel)]="user.name"
                   name="user_name" size="36"
                   required
                   pattern="[a-z]([-a-z0-9]*[a-z0-9])?"
                   maxlength="24"
                   (keyup)='handleValidation()'>
            <span class="tooltip-content">
              用户名称不符合规范，验证规则[a-z]([-a-z0-9]*[a-z0-9])?
            </span>
          </label>
          <span class="spinner spinner-inline" [hidden]="!checkOnGoing"></span>
        </div>
        <div class="form-group" style="padding-left: 135px;">
          <label for="user_email" class="col-md-3 form-group-label-override required">邮箱</label>
          <label for="user_email" aria-haspopup="true" role="tooltip" [class.invalid]="!isNameValid" class="tooltip tooltip-validation tooltip-md tooltip-bottom-left">
            <input type="text" id="user_email"  [(ngModel)]="user.email"
                   name="user_email" size="36"
                   required
                   maxlength="128"
                   >
            <span class="tooltip-content">
              用户邮箱不符合规范
            </span>
          </label>
          <span class="spinner spinner-inline" [hidden]="!checkOnGoing"></span>
        </div>
        <div class="form-group" style="padding-left: 135px;">
          <label for="user_display" class="col-md-3 form-group-label-override required">展示</label>
          <label for="user_display" aria-haspopup="true" role="tooltip" [class.invalid]="!isNameValid" class="tooltip tooltip-validation tooltip-md tooltip-bottom-left">
            <input type="text" id="user_display"  [(ngModel)]="user.display"
                   name="user_display" size="36"
                   required
                   maxlength="128"
                   >
            <span class="tooltip-content">
              用户展示不符合规范
            </span>
          </label>
          <span class="spinner spinner-inline" [hidden]="!checkOnGoing"></span>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-outline" (click)="onCancel()">取消</button>
          <button type="button" class="btn btn-primary" [disabled]="!isValid" (click)="onSubmit()">提交</button>
        </div>
      </section>
    </form>
  </div>
</clr-modal>
